<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>社团登录</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
    <meta name="viewport" content="width=device-width, user-scalable=no">
    <meta content="yes" name="apple-mobile-web-app-capable">
    <meta name="apple-mobile-web-app-status-bar-style" content="default"/>
    <meta name="apple-mobile-web-app-status-bar-style" content="black"/>
    <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent"/>
    <meta content="telephone=no" name="format-detection">
    <meta content="email=no" name="format-detection">
    <meta name="format-detection" content="telephone=no"/>
    <link href="${s.base}/mobile/css/weui.min.css" rel="stylesheet"/>
    <link href="${s.base}/mobile/css/jquery-weui.css" rel="stylesheet">
    <link href="${s.base}/mobile/css/cy-style.css" rel="stylesheet">
    <link href="${s.base}/mobile/css/question/questionnaire.css" rel="stylesheet">
    <script type="text/javascript" src="${s.base}/mobile/js/jquery-2.1.4.min.js"></script>
    <script type="text/javascript" src="${s.base}/mobile/js/fontSize.js"></script>
</head>
<body>
<div class="conent-640">
    <div class="top-style"><img src="${s.base}/mobile/images/stzx.png"></div>
    <form>
        <div class="div-line-input">
            <img src="${s.base}/mobile/images/username.png">
            <input type="text" id="loginName" placeholder="请输入用户名">
        </div>
        <div class="div-line-input">
            <img src="${s.base}/mobile/images/password.png">
            <input type="password" id="password" placeholder="请输入密码">
        </div>
        <button type="button" id="submit">登录</button>
    </form>
</div>
<script type="text/javascript" src="${s.base}/mobile/js/jquery-2.1.4.min.js"></script>
<script type="text/javascript" src="${s.base}/mobile/js/jquery-weui.js"></script>
<script type="text/javascript" src="${s.base}/mobile/js/common.js"></script>
</body>
<script type="text/javascript">
    var winHeight = $(window).height(); //获取当前页面高度
    $(window).resize(function() {
        var thisHeight = $(this).height();
        if (winHeight - thisHeight > 50) {
            //当软键盘弹出，在这里面操作
            //alert('aaa');
            $('body').css('height', winHeight + 'px');
        } else {
            //alert('bbb');
            //当软键盘收起，在此处操作
            $('body').css('height', '100%');
        }
    });
    var token = '${token}';
    var applyId = '${applyId}';
    // 提交绑定
    $("#submit").on("click",function () {
        var loginName = $("#loginName").val();
        if (loginName == null || loginName == "") {
            $.toast("请输入用户名","text");
            return false;
        }
        var password = $("#password").val();
        if (password == null || password == "") {
            $.toast("请输入密码","text");
            return false;
        }
        $.fn.doPost('/phone/association/login', {token:token,applyId:applyId,loginName:loginName,password:password}, function (result) {
            if (result.code == 0){
                window.location.href = "/phone/association/associationList?token="+token+"&applyId="+applyId;
            }else {
                $.toast(result.msg,"text");
            }
        });
    });
</script>
</html>
